package com.sofwin.util;


import org.csource.common.MyException;
import org.csource.fastdfs.ClientGlobal;
import org.csource.fastdfs.StorageClient;
import org.csource.fastdfs.TrackerClient;
import org.csource.fastdfs.TrackerServer;

import java.io.File;
import java.io.IOException;

public class FastdfsUtil {

    public static void main(String[] args) throws IOException, MyException {

        ClientGlobal.init("fastdfs.conf");
        TrackerClient trackerClient = new TrackerClient();
        TrackerServer trackerService = trackerClient.getConnection();
        StorageClient storageClient = new StorageClient(trackerService,null);
        File file = new File("E:\\1.png");
        System.out.println(file);
        String[] string = storageClient.upload_appender_file(file.getPath(), null, null);
        System.out.println(string);

    }


}
